Skip to content

fix(install): verified replaces, preserved MCP env, truthful self-update - #120

Merged
quangdang46 merged 2 commits into
mainfrom
fix/verified-installer-update
Sep 17, 2026
Merged

quangdang46 merged 2 commits into
mainfrom
fix/verified-installer-update

Conversation

@quangdang46

Copy link
Copy Markdown
Owner

Reproduced with the exact README Windows installer: it downloaded and checksum-verified v0.9.18, printed [OK], but left the locked MCP exe at 0.9.16 and copied that stale binary over the newer Cargo copy.

Root cause

  • install.ps1 Install-BinaryAtomic: Remove/Move failed silently on the locked exe; if (Test-Path) then mistook the surviving old binary for success and skipped the rename fallback.
  • The PATH-copy step sourced from the (stale) primary destination, downgrading the other install.
  • The final [OK] never compared installed vs requested version.
  • MCP JSON upsert replaced the whole hashline entry (dropping env) and PS5 ConvertFrom-Json rejected case-distinct keys.

Fix

  • Transactional replaces with terminating errors, unique staging/retire names, rollback, and SHA-256 verification; loud failure instead of false success.
  • PATH copies sourced from the extracted release payload, verified, best-effort with accurate reporting.
  • Final version gate before [OK].
  • JSON merge preserves env/unknown fields and exact-case keys on PS 5.1 and 7; invalid configs skipped untouched.
  • Self-update verifies installed bytes/version and rolls back on probe failure; unique Windows retirements; reports exact path, leaves other installs and running MCP sessions untouched.

Tests (isolated, no live config/PATH/network touched)

  • scripts/test-installer.ps1: 19/19 pass (normal, locked delete-share, hard-lock loud failure, JSON fixtures incl. case-distinct keys, dotted amp key).
  • cargo test -p hashline --test update_e2e --locked --offline: 10/10.
  • cargo test -p hashline --lib --locked --offline: 337/337.
  • cargo fmt --all --check, git diff --check: clean.
  • install.ps1 parses clean on PS 5.1; bash -n install.sh clean.

Windows locked-exe false success: Install-BinaryAtomic no longer treats a
surviving old binary as success; unique retire/promote/rollback with hash
verification; final version gate before [OK]. PATH copies source from the
extracted release and verify; MCP JSON merge preserves env and exact-case
keys on PS 5.1/7. Self-update verifies installed bytes/version, unique
Windows retirements, rollback on probe failure. Regression tests:
scripts/test-installer.ps1 (19 checks), update_e2e native-exe fixtures.
hashline guide never mentioned the opt-in fresh-anchor feature added
yesterday (--emit-anchors, HASHLINE_RETURN_ANCHORS=1, MCP
return_updated_anchors) despite it shipping with CLI/MCP support and
tests. Add it to the flags list, a chained-edit example, and tips.
@quangdang46
quangdang46 merged commit 30ef433 into main Sep 17, 2026
5 checks passed
@quangdang46
quangdang46 deleted the fix/verified-installer-update branch September 17, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant